import 'dart:convert';

import 'package:juming_test/model/domain/domain_filter_section_model.dart';
import 'package:logger/logger.dart';
import 'package:flutter/services.dart' show rootBundle;

class DomainAction {
  // 日志打印
  final Logger logger = Logger();

  // 获取高级筛选配置数据
  static Future<List<DomainFilterSectionModel>> fetchFilterSectionList() async {
    String jsonString = await rootBundle.loadString(
      'assets/jsons/domain_filter_option.json',
    );
    List<dynamic> jsonList = json.decode(jsonString);
    return jsonList
        .map((json) => DomainFilterSectionModel.fromJson(json))
        .toList();
  }
}
